﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="modal-dialog x-modal-dialog" style="width:700px; margin-top: 50px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb no-bottom-border clearfix">

      <h2><i class="glyphicon glyphicon-fire" title="创建订单"></i>&nbsp;&nbsp;标记为拒绝</h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/user-source/${id}/return" data-validate="true">
    
      
      <div class="modal-body">
        
        <div class="form-group x-form-group">
          <label class="col-xs-4 control-label">拒绝原因</label>
          <div class="pull-left col-xs-8">
            <input name="remark" type="text" class="form-control">
          </div>
        </div>
        
      </div>

      <div class="modal-footer clearfix">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div> 
    </form>

  </div>

</div>

<script src="${ctx.resource}/js/component/bootstrap.validate.js"></script>
<script src="${ctx.resource}/js/component/bootstrap.validate.en.js"></script>
<script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
<script>
$(document).ready(function(){
	
  $('form').shiftform({
    beforeSubmit : function(el) {
      $('form').trigger("validate.ajax.submit");
      return $.bt_validate.result[$.bt_validate.form_id]
    },
    failure: function(code, e, bg, mg, url) {
    	if(code == "600") {
    		
    		$("#addModal").modal("hide");
 	      $("#addRecord").attr("href", window.__CTX__.root + url)
 	      $("#addRecord").trigger("click");
    	} else {
    		window.location.reload();
    	}
    },
  });
});
</script>